package org.batatasframework.logger;

import javax.persistence.Column;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import cn.bonoon.kernel.support.entities.AbstractPersistable;
import cn.bonoon.kernel.support.entities.Persistable;

@MappedSuperclass
public abstract class AbstractFieldAmendmentRecord<L extends Persistable, E extends Persistable> extends AbstractPersistable implements FieldAmendmentRecordable{

	private static final long serialVersionUID = 6538495120394527542L;

	@ManyToOne
	@JoinColumn(name = "R_LOGGER_ID")
	private L logger;
	
	@ManyToOne
	@JoinColumn(name = "R_SOURCE_ID")
	private E source;
	
	@Column(name = "C_FIELDNAME", length = 100)
	private String fieldName;
	
	@Column(name = "C_OLDVALUE", length = 500)
	private String oldValue;
	
	@Column(name = "C_NEWVALUE", length = 500)
	private String newValue;

	public E getSource() {
		return source;
	}
	public void setSource(E source) {
		this.source = source;
	}
	public String getFieldName() {
		return fieldName;
	}
	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}
	public String getOldValue() {
		return oldValue;
	}
	public void setOldValue(String oldValue) {
		this.oldValue = oldValue;
	}
	public String getNewValue() {
		return newValue;
	}
	public void setNewValue(String newValue) {
		this.newValue = newValue;
	}
	public L getLogger() {
		return logger;
	}
	public void setLogger(L logger) {
		this.logger = logger;
	}
	
}
